import java.util.Scanner;

public class max_yue_and_min_gong {
    //李艺（防伪小标签）
    public static int max_yue(int a, int b) {
        /*辗转法*/
        while (true) {
            a = a % b;
            if (a == 0) {
                return b;
            }
            b = b % a;
            if (b == 0) {
                return a;
            }
        }
    }
    public static int min_gong(int a,int b){
        return a*b/max_yue(a,b);
    }
        public static void main(String[] args){
            Scanner scanner = new Scanner(System.in);
            int num1 = scanner.nextInt();
            int num2 = scanner.nextInt();
            System.out.println("最大公约数是：" + max_yue(num1, num2));
            System.out.println("最小公倍数是：" + min_gong(num1, num2));
    }
}